var wetlandParkId = $("#wetlandParkId").val();
var longitude;
var latitude;
var scale;
var overview = $("a[href='#overviewshow']");
var basicInfo = $("a[href='#basicInfoshow']");
var wetlandType = $("a[href='#wetlandTypeshow']");
var naturaFeature = $("a[href='#naturaFeatureshow']");
var wetlandPlant = $("a[href='#wetlandPlantshow']");
var wetlandAnimal = $("a[href='#wetlandAnimalshow']");
var ecologicalFun = $("a[href='#ecologicalFunshow']");
var socioEconomic = $("a[href='#socioEconomicshow']");
var protectionMainBody = $("a[href='#protectionMainBodyshow']");
var managementOrganization= $("a[href='#managementOrganizationshow']");
var landOwnership = $("a[href='#landOwnershipshow']");
var threatenedStatus = $("a[href='#threatenedStatusshow']");
var multiMedia = $("a[href='#multiMediashow']");

//信息提交成功后在tab页上显示的提示信息
var successHTML = '<i class="green ace-icon fa fa-check-circle bigger-120"></i>';
//信息有误在tab页上显示的提示信息
var warnHTML = '<i class="red ace-icon fa fa-exclamation-circle bigger-120"></i>';

$(function() {
	getInfos();
	$('a[data-toggle="tab"]').on('shown.bs.tab', function(e) {
		// 获取已激活的标签页的名称
		var activeTab = $(e.target).attr("href");
		if(activeTab == "#basicInfoshow"){
			gismap();
		}else if(activeTab == "#wetlandTypeshow"){
			typegismap();
		}else if(activeTab == "#socioEconomicshow"){
			soilgismap();
		}else if(activeTab == "#protectionMainBodyshow"){
			sgismap();
		}	
	});

});



function back() {
	history.back();
}
function getInfos(){
	var id =$("#wetlandParkId").val();
	$.ajax({
		url : "findbyid",
		dataType : "json",
		type : "POST",
		data : {id:id},
		async : false,
		error : function(error) {
			console.log(error.responseText);

			$.gritter.add({
				title : '服务器错误',
				text : '对不起，服务器错误，请联系系统管理员！',
				class_name : 'gritter-error'
			});

		},
		success : function(strValue) {
			if (strValue != null) {
				latitude=strValue.wlin_latitude;
				longitude=strValue.wlin_longitude;
				scale=strValue.wlin_scale;
			}
		}
	});
}